import java.util.Arrays;

public class num455 {
    public int findContentChildren(int[] g, int[] s) {
        int count = 0;
        int i = 0,j = 0;
        Arrays.sort(g);
        Arrays.sort(s);
        while (j < s.length) {
            if(s[j] >= g[i]) {
                count ++;
                i ++;
                if(i == g.length) {
                    break;
                }
            }
            j ++;
        }
        return count;
    }
}
